package com.youth.mq.consumer;

import com.youth.mq.MySink;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Sink;

/**
 * @ClassName OrderStreamConsumer
 * @Description: TODO 消息接收端。stream提供了Sink，Sink源码绑定的是input，和配置文件相关联
 * @Author yjwu
 * @Date 2020/3/14 16:08
 **/
@EnableBinding(MySink.class)
public class OrderStreamConsumer {

    @StreamListener(MySink.INPUT)
    public void receive(Object payload) {
        System.out.println("OrderStreamConsumer -->" + payload);
    }
}
